package com.im.test;

import java.util.concurrent.ConcurrentHashMap;

public class Message {

	private String apiUrl;
	private String params;
	private String type;
	
	private volatile int hascode = 0;
	
	public String getApiUrl() {
		return apiUrl;
	}
	public void setApiUrl(String apiUrl) {
		this.apiUrl = apiUrl;
	}
	public String getParams() {
		return params;
	}
	public void setParams(String params) {
		this.params = params;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	
	@Override
	public String toString() {
		return "apiUrl=" + apiUrl + ", params=" + params + ", type=" + type;
	}
	
	@Override
	public int hashCode() {
		int result = hascode;
		if(result == 0){
			result = 17;
			result = result*31 + apiUrl.hashCode();
			result = result*31 + params.hashCode();
			result = result*31 + type.hashCode();
			hascode = result;
		}
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		
		if(this == obj){
			return true;
		}else if(!(obj instanceof Message)){
			return false;
		}
		Message mo = (Message)obj;
		
		return this.toString().equals(mo.toString());
	}
	
	
}
